#include<iostream>
using namespace std;
void reverseA(int A[],int j){
   int i=0;
  // int j=sizeof(A)/sizeof(A[0])-1;
   while (i<j){
    int temp=A[i];
    A[i]=A[j];
    A[j]=temp;
    ++i;
    --j;
   }
}
int main(){
int arr[5]={1,2,3,4,5};
reverseA(arr,5);
for(int i=1;i<=5;i++)
   cout<<arr[i]<<endl;
}